import { axios } from '@/utils/request'

export function fetchList (params) {
  return axios({
    url: '/cmsPost/page',
    method: 'GET',
    params: {
      ...params
    }
  })
}
export function getObj (id) {
  return axios({
    url: `/cmsPost/${id}`,
    method: 'GET'
  })
}
export function save (params) {
  return axios({
    url: '/cmsPost/save',
    method: 'POST',
    data: params
  })
}
export function update (params) {
  return axios({
    url: '/cmsPost/update',
    method: 'PUT',
    data: params
  })
}
// 保存文章
export function saveByPost (params) {
  return axios({
    url: '/cmsPost/saveByPost',
    method: 'POST',
    data: params
  })
}
// 修改文章
export function updateByPost (params) {
  return axios({
    url: '/cmsPost/updateByPost',
    method: 'POST',
    data: params
  })
}
// 回收站
export function setRecycle (params) {
  return axios({
    url: '/cmsPost/recycle',
    method: 'POST',
    data: params
  })
}
